<template>
  <div class="daka_Box">
    <div class="motai" ref="motai" @click="disappear">
      <img :src="src1" alt="" />
    </div>
    <div class="dakabox" v-for="item in resdata" :key="item.id">
      <img :src="item.dakaimg" alt="" class="touxiang"  @click="todaka(item.xuehao)"/>
      <div class="info">
        <div class="info_left">
          <p class="daka_top">
            <a href="" class="dakaname">{{ item.name }}</a>
            <span class="iconfont icon-renzheng"></span>
          </p>
          <a href="" class="fensi">
            <span class="gznumber">{{ item.fensi }}</span>
            <span class="gz">人关注</span></a
          >

          <div class="list">
            <span href="" class="kongjian" @click="todaka(item.xuehao)">TA的个人空间</span>
            <button class="guanzhu">关注</button>
          </div>
        </div>
        <div class="img_group">
          <!-- <img src="https://ss.lanqb.com/402b1dd4-f6c8-458f-b51e-5c426d847bda.jpg?imageView2/1/w/280/h/210" alt="" class="zuoping" /> -->
          <img
            :src="item.img3[0].dakazuopinimg"
            alt=""
            class="zuoping"
            @click="beBig(item.img3[0].dakazuopinimg)"
          />
          <img
            :src="item.img3[1].dakazuopinimg"
            alt=""
            class="zuoping"
            @click="beBig(item.img3[1].dakazuopinimg)"
          />
          <img
            :src="item.img3[2].dakazuopinimg"
            alt=""
            class="zuoping"
            @click="beBig(item.img3[2].dakazuopinimg)"
          />
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      resdata: [],
      src1: "",
    };
  },
  methods: {
    todaka(xuehao){
       this.$router.push({
        name: "wodeceshi",
        query: { xuehao },
      });
      // this.axios.get("/dakazhuye",{params:{xuehao}})
    },
    beBig(imgSrc) {
      this.src1 = imgSrc;
      this.$refs.motai.style.display = "flex";
    },
    disappear() {
      this.$refs.motai.style.display = "none";
    },
  },
  mounted() {
    this.axios.get("/Daka/daka").then((res) => {
    console.log(res.data);
      this.resdata = res.data;
    });
  },
};
</script>
<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}
a {
  text-decoration: none;
}
.iconfont{
  color:#f5cb6f;
}
.motai {
  width: 100%;
  height: 100vh;
  z-index: 500;
  justify-content: center;
  align-items: center;
  background-color: rgba(58, 58, 58, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  -webkit-animation-name: zoom;
  -webkit-animation-duration: 1s;
  animation-name: zoom;
  animation-duration: 0.6s;
  display: none;
}

@-webkit-keyframes zoom {
  from {
    -webkit-transform: scale(0);
  }
  to {
    -webkit-transform: scale(1);
  }
}

@keyframes zoom {
  from {
    transform: scale(0.1);
  }
  to {
    transform: scale(1);
  }
}

.motai img {
  /* margin-top: 100px; */
  width: 400px;
  height: 600px;
  object-fit: cover;
}
.daka_Box {
  // background-color: rgb(236, 236, 236);
  .dakabox {
    width: 1140px;
    height: 160px;
    background-color: rgb(245, 245, 245);
    display: flex;
    justify-content: flex-start;
    padding: 40px 20px;
    margin-bottom: 20px;
    margin-top: 40px;
    border-radius: 10px;
    .touxiang {
      width: 120px;
      height: 120px;
      border-radius: 50%;
      background-color: rgb(123, 247, 123);
    }
    .info {
      margin-left: 30px;
      display: flex;
      justify-content: space-between;
      .info_left {
        width: 260px;
        height: 200px;
        margin-right: 40px;
        .fensi {
          display: inline-block;
          margin-top: 20px;
          margin-bottom: 20px;
        }
        .dakaname {
          font-size: 20px;
          font-weight: 600;
          color: #212b34;
        }
        .gznumber {
          font-size: 16px;
          color: #212b34;
          font-weight: 500;
        }
        .gz {
          font-size: 16px;
          color: #9f9f9f;
        }
        .list {
          .kongjian {
            display: inline-block;
            width: 132px;
            height: 38px;
            font-size: 14px;
            border: none;
            background-color: #fbf5e8;
            color: #634b19;
            text-align: center;
            line-height: 38px;
            border-radius: 5px;
            transition: all 0.5s;
            &:hover {
              background-color: #edce8c;
            }
          }
          .guanzhu {
            width: 106px;
            height: 38px;
            font-size: 14px;
            color: #634b19;
            background-color: #edce8c;
            border: none;
            border-radius: 5px;
            margin-left: 10px;
            transition: all 0.5s;
            &:hover {
              background-color: #dfc07d;
            }
          }
        }
      }
      .img_group {
        width: 680px;
        height: 164px;
        display: flex;
        justify-content: space-between;
        .zuoping {
          width: 218px;
          height: 164px;
          border-radius: 6px;
        }
      }
    }
  }
}
</style>